package com.suyang.syt.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.suyang.syt.dao.interfaces.WeixinMsgImageTextDao;
import com.suyang.syt.model.WeixinMsgImageText;
import com.suyang.syt.util.EmptyUtil;

@Repository
public class WeixinMsgImageTextDaoImpl extends BaseDaoImpl<WeixinMsgImageText> implements WeixinMsgImageTextDao {

	@Override
	public void deletes(String ids) {
		String hql = " delete from WeixinMsgImageText where id in(" + ids + ")";
		this.executeByHql(hql);
	}

	@Override
	public List<WeixinMsgImageText> listInIds(String ids) {
		if (EmptyUtil.isNotEmpty(ids)) {
			List<WeixinMsgImageText> list = new ArrayList<WeixinMsgImageText>();
			String[] idsArr = ids.split(",");
			for (String id : idsArr) {
				list.add(this.load(Long.parseLong(id)));
			}
			return list;
		}
		return null;
	}

}
